//
//  DateUtil.m
//  FreeTime
//
//  Created by  on 16/8/29.
//  Copyright © 2016年 SRDZ.com. All rights reserved.
//

#import "DateUtil.h"

@implementation DateUtil
+(NSDate*)creatDateWithYear:(NSString *)year month:(NSString *)month day:(NSString *)day{
    NSDateComponents * comps = [[NSDateComponents alloc] init];
    comps.year = [year integerValue];
    comps.month = [month integerValue];
    comps.day = [day integerValue];
    NSCalendar * calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
    return [calendar dateFromComponents:comps];
    
}
+ (NSDateFormatter*)formatDate{
    NSDateFormatter *format = [[NSDateFormatter alloc] init];
    [format setDateFormat:DATE_FORMAT];
    return format;
}

@end
